package com.epam.util;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PropertyReader {
	private static final Logger LOGGER = LoggerFactory
			.getLogger(PropertyReader.class);
	private static ResourceBundle bundle;
	public static final String BUNDLE_NAME = "initpool";

	public static String getProperty(String propertyName) {
		if (bundle == null) {
			bundle = ResourceBundle.getBundle(BUNDLE_NAME);
		}
		try {
			return bundle.getString(propertyName);
		} catch (MissingResourceException e) {
			LOGGER.warn(e.getMessage());
			;
			return null;
		}
	}
}
